/*
通用OTDR

2021.7.28 by Menglong Wu
*/
#include "port.h"
#include "fpga-common.h"
#include "fpga-private.h"
#include "interface/protocal-otdr.h"
#include "interface/protocal-ocid.h"


static struct priv_otdr_data data_ocid = {
    .cache_len   = 64000 * 4 + 4000,
    .sample_byte = 64 * 1000 * 4,
};

static struct fpga_if ocid_interface = {
    DEFAULT_FPGA_IF,
    .pfun_probe      = cb_fpga_ocid_probe,
    .pfun_release    = cb_fpga_ocid_release,
    .private_data    = &data_ocid,
    .name            = "this-ocid",
    .pfun_start      = cp_fpga_ocid_start,
    .pfun_stop       = cp_fpga_ocid_stop,
    .pfun_set_gpio   = cp_ocid_set_gpio,
    .pfun_get_gpio   = none_get_gpio,
    .pfun_version    = com_fpga_version,
    .pfun_read_frame = cp_fpga_read_ocid_data,
};

static void __attribute__((constructor(INIT_BSP))) this_init()
{
    // fpga_if_register(&otdr_interface_32k);
    fpga_if_register(&ocid_interface);
}